<template>
  <div class="login">
    <div class="top_username">
      <div class="top">
        <div class="top_img">
          <img src="../assets/images/uTools_1667436282717.png" alt="">
        </div>
      </div>
      <div class="font">
        <div style="font-size:25px;margin-top:15px;">登 录</div>
      </div>
      <div class="font">
        <span style="color:gray;margin-top:14px">欢迎使用OA办公后台管理系统</span>

      </div>
      <div class="main">
        <div class="shang">
          <input type="text" v-model="form.username" placeholder="请输入手机号或工号">
        </div>
        <div class="xia">
          <input type="password" v-model="form.userpass" placeholder="请输入密码">
        </div>
      </div>
      <div class="denglu">
        <div class="btn" @click='biubiu'>
          登录
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from "vue";
import { useRouter } from "vue-router";
const router = useRouter();

let form = ref({
  username:'',
  userpass:''
})

const biubiu = () => {

  if(form.value.username == 'admin' && form.value.userpass == 1234) {
    router.push('/maxindex')
    // location.reload();
  } else {
    alert('请输入正确的账号密码')
  }
  // setTimeout(() => {
  //   location.reload();
  // }, 100);
}
</script>

<style lang='scss'>
.denglu {
  width: 100%;
  height: 40px;
  //   background-color: aqua;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  .btn {
    width: 84%;
    height: 100%;
    background-color: #0078ff;
    border-radius: 10px;
    text-align: center;
    line-height: 40px;
    color: #fff;
  }
}
.main {
  margin-top: 20px;
  width: 100%;
  height: 140px;
  //   background-color: aqua;
  .shang {
    width: 100%;
    height: 70px;
    // background-color: orange;
    display: flex;
    justify-content: center;
    align-items: center;
    input {
      width: 80%;
      height: 34px;
      border: 1px solid gray;
      outline: none;
      border-radius: 10px;
      padding-left: 15px;
    }
  }
  .xia {
    width: 100%;
    height: 70px;
    // background-color: red;
    display: flex;
    justify-content: center;
    align-items: center;
    input {
      width: 80%;
      height: 34px;
      border: 1px solid gray;
      outline: none;
      border-radius: 10px;
      padding-left: 15px;
    }
  }
}
.font {
  width: 100%;
  height: 30px;
  //   background-color: red;
  display: flex;
  justify-content: center;
  align-items: center;
}
.login {
  background-image: url("../assets/images/b2.jpg");
  width: 100%;
  height: 710px;
  background-size: 100% 100%;
  background-attachment: fixed;
  display: flex;
  justify-content: center;
  align-items: center;
  .top_username {
    width: 350px;
    height: 500px;
    background-color: #fff;
    border-radius: 25px;
    .top {
      width: 100%;
      height: 50px;
      //   background-color: aqua;
      margin-top: 40px;
      display: flex;
      justify-content: center;
      align-items: center;
      .top_img {
        width: 15%;
        height: 100%;
        img {
          width: 100%;
          height: 100%;
        }
      }
    }
  }
}
</style>